﻿@model IEnumerable<Leo.Entities.Empleado>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>
<fieldset>
    <legend>Buscar:</legend>
    @using (Html.BeginForm())
    { 
        <b>Criterio:</b>
        @Html.TextBox("criterio")
        <input type="submit" name="btnBuscar" value="Buscar" />
    }
</fieldset>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.DNI)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Nombres)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Apellidos)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Telefono)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.UserName)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Password)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.IdRol)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.DNI)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Nombres)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Apellidos)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Telefono)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.UserName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Password)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.IdRol)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
            @Html.ActionLink("Details", "Details", new { id=item.Id }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.Id },new { onClick="return confirm('¿Desea Eliminar: "+item.Nombres+", "+item.Apellidos+"?');"})
        </td>
    </tr>
}

</table>
